import request from '@/utils/request'

//获取用户信息
export function reqUserInfoList (limit=20,offset=0){
    return request({
        url:`/v1/users/list?limit=${limit}&offset=${offset}`,
        method:'get'
    })
}

//获取用户数量
export function reqUserCount(){
    return request({
        url:'/v1/users/count',
        method:'get'
    })
}

//获取管理员数量
export function reqAdminCount(){
    return request({
        url:`/admin/count`,
        method:'get'
    })
}

//获取管理员列表
export function reqAdminList(limit=20,offset=0){
    return request({
        url:`/admin/all?offset=${offset}&limit=${limit}`,
        method:'get'
    })
}

//获取订单列表
export function reqOrderList(offset=0,limit=20,restaurant_id=undefined){
    return request({
        url:`/bos/orders?offset=${offset}&limit=${limit}&restaurant_id=${restaurant_id}`,
        method:'get'
    })
}

//获取订单数量
export function reqOrderCount(){
    return request({
        url:'/shopping/restaurants/count',
        method:'get'
    })
}

//获取订单详细信息(包含用户姓名,地址)

export function reqDetailOrderUser(user_id){
    return request({
        url:`/v1/user/${user_id}`,
        method:'get'
    })
}
export function reqDetailOrderAdderss(address_id){
    return request({
        url:`/v1/addresse/${address_id}`,
        method:'get'
    })
}
export function reqDetailOrderRes(restaurant_id){
    return request({
        url:`/shopping/restaurant/${restaurant_id}`,
        method:'get'
    })
}